Skip to content

Revert "訊息閱讀器功能改進與 bug 修正"#49

Merged
keyang556 merged 1 commit intomainfrom
revert-48-claude/gracious-wright
Apr 9, 2026
Merged

Revert "訊息閱讀器功能改進與 bug 修正"#49
keyang556 merged 1 commit intomainfrom
revert-48-claude/gracious-wright

Conversation

@keyang556
Copy link
Copy Markdown
Owner

@keyang556 keyang556 commented Apr 9, 2026

Reverts #48

Greptile Summary

此 PR 將 PR #48(「訊息閱讀器功能改進與 bug 修正」)的所有變更還原,將 addon/appModules/_chatParser.pyaddon/appModules/line.py 恢復到 PR #47 合併後的狀態。

Confidence Score: 4/5

此 PR 為乾淨且完整的還原,可安全合併,但未說明還原原因。

還原操作正確且完整:PR #48 所修改的兩個檔案(_chatParser.py、line.py)均被還原至 PR #47 合併後的狀態,其餘檔案(_messageReader.py 等)未受影響且介面相容。唯一的顧慮是 PR 描述未說明還原的原因,令人難以判斷 PR #48 的改進是否因新 bug 而需放棄。

無需特別關注的檔案,但建議補充說明還原 PR #48 的原因。

Vulnerabilities

未發現安全性問題。聊天紀錄檔案儲存路徑使用系統暫存目錄(tempfile.gettempdir()),並在讀取前先確認檔案存在,整體處理方式合理安全。

Important Files Changed

Filename Overview
addon/appModules/_chatParser.py 還原至 PR #47 狀態的聊天紀錄解析器,包含多行訊息支援與已修正的 _RECALL_RE 空格問題;邏輯正確。
addon/appModules/line.py 還原至 PR #47 狀態的主模組,訊息閱讀器流程(開啟、儲存、解析、呈現)結構完整;_messageReaderHandleSaveDialog 中有重複的 import tempfile(第 5944 與 5974 行),為既有輕微問題。

Sequence Diagram

sequenceDiagram
    participant User as 使用者
    participant line as line.py
    participant vw as ChatMoreOptions VirtualWindow
    participant dialog as 儲存對話框 (Win32)
    participant parser as _chatParser.py
    participant reader as _messageReader.py

    User->>line: script_openMessageReader()
    line->>line: _clickMoreOptionsButton()
    line->>vw: _activateMoreOptionsMenu()
    line->>vw: _messageReaderAutoClickSaveChat() [輪詢最多15次]
    vw-->>line: 點擊「儲存聊天」
    line->>dialog: _messageReaderHandleSaveDialog() [輪詢最多10次]
    dialog-->>line: dialogHwnd 找到
    line->>dialog: SendMessageW(WM_SETTEXT) 設定路徑
    line->>dialog: _messageReaderPressSave()
    dialog-->>line: 檔案儲存完成
    line->>line: _messageReaderHandleOverwrite() [覆寫確認]
    line->>line: _messageReaderOpenFile()
    line->>parser: parseChatFile(savePath)
    parser-->>line: messages[]
    line->>reader: openMessageReader(messages, cleanupPath=savePath)
    reader-->>User: 顯示訊息閱讀器對話框
Loading

Comments Outside Diff (1)

  1. addon/appModules/line.py, line 5974 (link)

    P2 重複的 import tempfile

    tempfile 在同一函式的第 5944 行(函式頂端與 ctypes 一起匯入)已匯入過一次,第 5974 行再次匯入為多餘語句。Python 模組快取機制使此無害,但建議移除以保持程式碼簡潔。

    此為 PR 新增訊息閱讀器功能 (NVDA+Windows+J) #47 狀態即已存在的既有問題,非本次還原所引入。

    Prompt To Fix With AI
    This is a comment left during a code review.
    Path: addon/appModules/line.py
    Line: 5974
    
    Comment:
    **重複的 `import tempfile`**
    
    `tempfile` 在同一函式的第 5944 行(函式頂端與 `ctypes` 一起匯入)已匯入過一次,第 5974 行再次匯入為多餘語句。Python 模組快取機制使此無害,但建議移除以保持程式碼簡潔。
    
    
    
    此為 PR #47 狀態即已存在的既有問題,非本次還原所引入。
    
    How can I resolve this? If you propose a fix, please make it concise.

    Fix in Claude Code Fix in Codex

Fix All in Claude Code Fix All in Codex

Prompt To Fix All With AI
This is a comment left during a code review.
Path: addon/appModules/line.py
Line: 5974

Comment:
**重複的 `import tempfile`**

`tempfile` 在同一函式的第 5944 行(函式頂端與 `ctypes` 一起匯入)已匯入過一次,第 5974 行再次匯入為多餘語句。Python 模組快取機制使此無害,但建議移除以保持程式碼簡潔。

```suggestion
		savePath = os.path.join(tempfile.gettempdir(), "lineDesktop_chat_export.txt")
```

此為 PR #47 狀態即已存在的既有問題,非本次還原所引入。

How can I resolve this? If you propose a fix, please make it concise.

Reviews (1): Last reviewed commit: "Revert "訊息閱讀器功能改進與 bug 修正"" | Re-trigger Greptile

(5/5) You can turn off certain types of comments like style here!

@keyang556 keyang556 merged commit f138618 into main Apr 9, 2026
2 of 3 checks passed
@keyang556 keyang556 deleted the revert-48-claude/gracious-wright branch April 9, 2026 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant